using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Masood.MobileGames.SlidingLib.Abstract;
using System.Windows.Media.Imaging;


namespace Masood.MobileGames.SlidingLib.Box
{
    public class ImageBox : AbstractBox
    {
        public ImageBox(int width, int height)
            : base(width, height)
        {
        }

        public ImageBox(float x, float y, int width, int height)
            : base(x, y, width, height)
        {
        }

        public ImageBox(ContentManager content, float x, float y, int width, int height)
            : base(content, x, y, width, height)
        {

        }

        public override void Draw(SpriteBatch spriteBatch)
        {
           spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
            
            Rectangle rect = new Rectangle(0, 0, this.width, this.height);                        
            Texture2D texture = content.Load<Texture2D>(string.Format("apple.{0}", this.text));
            if (this.texture2d != null)
                texture = texture2d;

            spriteBatch.Draw(texture, position, Color.White);
            spriteBatch.End();
        }
    }
}
